import request from '@/utils/request';

//获取列表
export function check(params = {}) {
    return request({
        url: '/check',
        method: "get",
        params,
        // isRefreshToken1: true,
    })
}

//订单结算信息
export function orderSettlementInformation(params = {}) {
    return request({
        url: '/orderSettlementInformation',
        method: 'get',
        params
    })
}

//保存支付订单
export function savePaymentBill(data = {}) {
    return request({
        url: '/savePaymentBill',
        method: 'post',
        data
    })
}

//获取支付订单详情
export function paymentBillDetail(params = {}) {
    return request({
        url: '/paymentBillDetail',
        method: 'get',
        params
    })
}

//第一次支付
export function firstPayment(data = {}) {
    return request({
        url: "/firstPayment",
        method: 'post',
        data
    })
}

//全量支付
export function payment(data = {}) {
    return request({
        url: "/payment",
        method: 'post',
        data
    })
}

//汇总代开
export function summary(params = {}) {
    return request({
        url: "/Summary",
        method: 'get',
        params
    })
}


export function batchModification(data = {}) {
    return request({
        url: '/batchModification',
        method: 'post',
        data,
    })
}

//同步支付信息

export function uploadPay(data = {}) {
    return request({
        url: '/uploadPay',
        method: 'post',
        data,
    })
}

//重新上传运单
export function uploadBill(data = {}) {
    return request({
        url: '/uploadBill',
        method: 'post',
        data
    })
}

/**
 * 发票管理列表
 * @params yund_id 分运单id
 * @params status 0全部1待申请2申请中3已开票
 * @params time 时间
 * @params invoice_no 发票号码
 * @params fleet_transfer_status 是否转账给车队长 0全部1未转账1转账
 * 
 * **/
export function invoicesList(params = {}) {
    return request({
        url: '/invoicesList',
        method: 'get',
        params
    })
}

/**申请开票
 * @param id 231528，231528
 * **/
export function applicationInvoices(data = {}) {
    return request({
        url: '/applicationInvoices',
        method: 'post',
        data
    })
}

/**
 * 司机流水列表
 * @param {name司机姓名,bank收款人,phone电话号码,page,pageSize} params 
 * @returns 
 */
export function driverFlow(params = {}) {
    return request({
        url: '/driverFlow',
        method: 'get',
        params
    })
}

/**
 * 上传支付图片
 * @param {id自增ID,pay_img图片URL} data 
 * @returns 
 */
export function uploadPayImg(data = {}) {
    return request({
        url: '/uploadPayImg',
        method: 'post',
        data
    })
}

/**
 * 司机流水银行卡信息
 * @param {driver_user_id} params 
 * @returns 
 */
export function driverFlowBank(params = {}) {
    return request({
        url: "/driverFlowBank",
        method: 'get',
        params
    })
}

/**
 * 发票明细
 * @param {batch_number批次号,status0全部1申请中2已开票} params 
 * @returns 
 */
export function invoiceDetails(params = {}) {
    return request({
        url: '/invoiceDetails',
        method: 'get',
        params
    })
}

/**
 * 发票明细详情
 * @param {batch_number批次号} params 
 * @returns 
 */
export function invoiceSubDetails(params = {}) {
    return request({
        url: '/invoiceSubDetails',
        method: 'get',
        params
    })
}

/**
 * 货主流水
 * @param {*} params 
 * @returns 
 */
export function shipperStatement(params = {}) {
    return request({
        url: "/shipperStatement",
        method: 'get',
        params
    })
}

/**
 * 货主流水充值
 * @param {happrove_id货主ID,money充值的金额} data 
 * @returns 
 */
export function recharge(data = {}) {
    return request({
        url: '/recharge',
        method: 'post',
        data
    })
}


/**
 * 货主流水充值记录
 * @param {pageSize} params 
 * @returns 
 */
export function rechargeList(params = {}) {
    return request({
        url: '/rechargeList',
        method: 'get',
        params
    })
}

/**
 * 支付结果验证
 * @param {*} params 
 * @returns 
 */
export function payResultList(params = {}) {
    return request({
        url: '/payResultList',
        method: 'get',
        params
    })
}

/**
 * 发票明细-开票
 * @param {batch_number批次号,invoice_number发票号,invoice_url发票链接} data 
 * @returns 
 */
export function Invoicing(data = {}) {
    return request({
        url: '/Invoicing',
        method: 'post',
        data
    })
}

/**
 * 财务审核导出
 * @param {time,2024-06-12 - 2024-06-12} params 
 * @returns 
 */
export function exportData(params = {}) {
    return request({
        url: '/exportData',
        method: 'get',
        params
    })
}
/**
 * 资金上拨
 * @param {source,transfer_amount} 上拨账号, 上拨金额
 * @returns 
 */
export function accountUp(data = {}) {
    return request({
        url: "/accountUp",
        method: 'post',
        data
    })
}

/**
 * 资金下拨
 * @param {source,transfer_amount} 上拨账号, 上拨金额
 * @returns 
 */
export function accountDown(data = {}) {
    return request({
        url: "/accountDown",
        method: 'post',
        data
    })
}

/**
 * 调拨记录
 * @param {bank_sub_account} 子账号 
 * @returns 
 */
export function getAccountAccount(params = {}) {
    return request({
        url: '/getAccountAccount',
        method: 'get',
        params
    })
}

/**
 * 获取下拨公司账户
 * @param {*} params 
 * @returns 
 */
export function getCompanyAccount(params = {}) {
    return request({
        url: '/getCompanyAccount',
        method: 'get',
        params
    })
}

/**
 * 货主添加编辑子账号
 * @param {id,sub_number} data 自增id,子账户
 * @returns 
 */
export function addSubBank(data = {}) {
    return request({
        url: "/addSubBank",
        method: 'post',
        data
    })
}

/**
 * 获取账户余额
 * @param {id} params 自增ID 
 * @returns 
 */
export function getAccountMoney(params = {}) {
    return request({
        url: '/getAccountMoney',
        method: 'get',
        params
    })
}